vcConnector
vcConnector allows you to establish connections between behaviors in order to transfer components. For example, flow type behaviors may have any number of connections (ports/connectors) to manage the receiving and sending of components.
See in: Overview
Module: vcCore
Parent: vcObject
Children -
Referenced by: vcComponentFlowProxy.createConnector(), vcComponentFlowProxy.getInternalConnector()
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| Behavior | vcBehavior | R | Gets the behavior that the connector is connected to in a component. If no connection, the value is None. |
| CapacityTest | vcConnectorTestLocation | RW | Gets or sets the mode for testing capacity before transferring a component to an outgoing connection. |
| Connection | vcConnector | RW | Gets or sets connector that the connector is connected to in a component. If no connection, the value is None. |
| Index | Integer | R | Gets the position of the connector in its behavior's list of connectors. |
| Name | String | RW | Gets or sets the name of connector. |
| Type | vcConnectorType | RW | Gets or sets the connector's type. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| connect | None | vcConnector OR None connector | Connects the connector to a given connector.See moreIf no argument is given, this method will remove all connections of the connector. Parameters: connector (vcConnector): Connector to connect to. |
| testCapacity | Boolean | vcComponent arg | Tests if the owner behavior has capacity for a component.See moreParameters: component (vcComponent): Component entering this port. Returns: bool: True if component can enter this port, otherwise False. Exceptions: ArgumentError: When given vcComponent is not a valid instance. |
| testConnectedCapacity | Boolean | vcComponent arg | Tests if connected connector's owner has capacity for a component.See moreParameters: component (vcComponent): Component entering this port. Returns: bool: True if component can enter this port, otherwise False. Exceptions: RuntimeError: When connected owner is not connected to another vcConnector. ArgumentError: When given vcComponent is not a valid instance. |
Example: Access and Connect Path Connectors
"""Example how to access and connect the paths inside the same component to each other using connectors""" import vcCore as vc async def OnRun(): comp = vc.getComponent() path1 = comp.findBehavior('Path1') path2 = comp.findBehavior('Path2') #access container“s specific connector from list of connectors outConnector = [x for x in path1.Connectors if x.Name == "Output"][0] #access container“s connector from the list of connectors with index inConnector = path2.Connectors[0] #connect Path1 output to Path2 input outConnector.connect( inConnector )